package demo512;

import java.io.*;
import java.util.Scanner;

public class Test {
    //数据写入文件
    public static void saveFileData(String fileName) throws IOException {
        FileWriter filterWriter = new FileWriter(fileName);

        BufferedWriter bufferedWriter = new BufferedWriter(filterWriter);
        //存储的数据
        bufferedWriter.write("鸡鸡");
        bufferedWriter.close();

    }

    public static void main(String[] args) throws IOException {

        Scanner scanner = new Scanner(System.in);
        String fileName = scanner.next();
        //数据写入文件
        saveFileData(fileName);
        //获取文件数据
        FileReader reader = new FileReader("1.txt");
        BufferedReader bufferedReader = new BufferedReader(reader);
        String readerLine;


        while ((readerLine=bufferedReader.readLine())!=null){
            System.out.println(readerLine);
        }
    }
    
}
